<template>
    <div>
        <input type="text" v-model="dependent">
        <h2>计算属性值:{{computedValue}}------数据类型为:{{typeof computedValue}}</h2>
        <h2>依赖的值:{{dependent}}------数据类型为:{{typeof dependent}}</h2>
        <h2>计算属性值会根据内部data属性值的改变而改变</h2>
    </div>
</template>

<script>
export default {
    name: "ComputedDemo",
    computed: {
        computedValue() {
            let count = 2
            count *= +this.dependent
            return count
        }
    },
    data() {
        return {
            dependent: 0,
        }
    },
};
</script>

<style lang="less" scoped>
</style>
